<?php

namespace App\Http\Controllers\admin;

use App\Dao\BusinessesDao;
use App\Dao\SbillsDao;
use App\Services\Code;

class SbillsController extends BaseController
{
    public function sbills()
    {
        if(getIsHasPage()){
            return Code::message('',200,SbillsDao::sbillsP(request()->all()));
        }
        $info = BusinessesDao::builder_query([
            'businesses_id'=>getShopId()
        ])->first()->toArray();
        return view('admin.sbills.sbills',[
            'info'=>$info
        ]);
    }

    public function withs()
    {
        if(isPost()){
            $params = request()->all();
            $params['shop_id'] = getShopId();
            BusinessesDao::withs($params);
            return  Code::message();
        }
        return view('admin.sbills.withs');
    }
}
